# ============================================================
# by howlink *
# Filename       : getOraUser.sh
#
# Description: get oracle user
# exmple: ./getOraUser orcl 
# =============================================================
#! /bin/bash


orauser=`cat /opt/howlink/lb-agent/application.properties | grep "^agent.oracle-user" | awk -F'=' '{ print $2 }' | sed 's/ //g'`
if [ -z "$orauser" ];then
    orauser=`ps -ef | grep ora_pmon | grep -v grep | head -n1 | sed -e 's/^[ \t]*//' | cut -d" " -f1`
fi

echo "$orauser"
